function myGod(id, w, n) {
    var box = document.getElementById(id),
        can = true,
        w = w || 1500,
        fq = fq || 10,
        n = n == -1 ? -1 : 1;
    box.innerHTML += box.innerHTML;
    box.onmouseover = function() {
        can = false
    };
    box.onmouseout = function() {
        can = true
    };
    var max = parseInt(box.scrollHeight / 2);
    new function() {
    	var stop = box.scrollTop % 62 == 0 && !can;
    	var navigatorName = "Microsoft Internet Explorer"; 
    	   var isIE = false;  
    	   if( navigator.appName == navigatorName ){  
    	    isIE = true;  
    	    stop = box.scrollTop % 60 == 0 && !can;
    	   }
        var stop = box.scrollTop % 60 == 0 && !can;
        if (!stop) {
            var set = n > 0 ? [max, 0] : [0, max];
            box.scrollTop == set[0] ? box.scrollTop = set[1] : box.scrollTop += n;
        };
        if(isIE){
        	 setTimeout(arguments.callee, box.scrollTop % 60 ? fq : w);
        }else{
        	 setTimeout(arguments.callee, box.scrollTop % 62 ? fq : w);
        }
    };
};
jQuery(document).ready(function($){
	//初始化默认值  省份ip判断，类型理
	//大学录取线
	$('.dxluq_province').html(provinceGkcxName=='全国'?'生源地':provinceGkcxName);
	$('.dxluq_type').html('理科');
	$(".dxlux_div input[name=province]").val(provinceGkcxName=='全国'?'生源地':provinceGkcxName);
	$(".dxlux_div input[name=fstype]").val('理科');
	//专业录取  初始化默认
	$(".zylqx_div input[name=province]").val(provinceGkcxName=='全国'?'生源地':provinceGkcxName);
	$(".zylqx_div input[name=fstype]").val('理科');
	//录取人数  初始化默认
	$(".lqrs_div input[name=argprovince]").val(provinceGkcxName=='全国'?'生源地':provinceGkcxName);
	$(".lqrs_div input[name=argluqutype]").val('理科');
	$(".lqrs_div input[name=argyear]").val('2013');
	$(".lqrs_year").html('2013');
	//专业录取线
	$('.zylqx_province').html(provinceGkcxName=='全国'?'全部':provinceGkcxName);
	$('.zylqx_type').html('理科');
	//录取人数
	$('.lqrs_province').html(provinceGkcxName=='全国'?'全部':provinceGkcxName);
	$('.lqrs_type').html('理科');
	//估分选大学
	$(".gfxdx_div input[name=province]").val(provinceGkcxName=='全国'?'北京':provinceGkcxName);
	$(".gfxdx_div input[name=type]").val('理科');
	$(".gfxdx_mark").val('550');
////////////////////////////////////////////////////////////////////////////////////////////////
//大学
$(".sdx_search").click(function(){
	var schoolname = $(".sdxname").val()=='请输入院校名称'?'':$(".sdxname").val();
	if(!validfun(schoolname))return false;
    window.open('/soudaxue/queryschool.html?keyWord1='+encodeURI(schoolname),'_blank');
});  
////////////////////////////////////////////////////////////////////////////////////////////////
//专业
$(".zzyb_search").click(function(){
    var zyxname = $(".zybxname").val()=='请输入专业名称'?'':$(".zybxname").val();
    if(!validfun(zyxname))return false;
    window.open('/soudaxue/queryspecialty.html?argzycengci=%E6%9C%AC%E7%A7%91&argspecialtyname='+encodeURI(zyxname),'_blank');
	});  
$(".zzyz_search").click(function(){
    var zyxname = $(".zyzxname").val()=='请输入专业名称'?'':$(".zyzxname").val();
    if(!validfun(zyxname))return false;
    window.open('/soudaxue/queryspecialty.html?argzycengci=%E4%B8%93%E7%A7%91&argspecialtyname='+encodeURI(zyxname),'_blank');
	}); 
////////////////////////////////////////////////////////////////////////////////////////////////
//大学录取线  省份
$(".dxluq_province_s").click(function(event){
	$(".div_floot").addClass('hide');
	  $(".dxlqx_p ").removeClass('hide');
	  event.stopPropagation();
});
$(".dxlqx_p a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.dxluq_province').html($(this).html());
		$(".dxlux_div input[name=province]").val($(this).html());
	}
	$(".div_floot").addClass('hide');
	  event.stopPropagation();
	});

$(".dxluq_type_span").click(function(event){
	event.stopPropagation();
	$('.pos_a').addClass('hide');
	$('.dxlqx_t ').removeClass('hide');
});

$(".dxlqx_t a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
	 $('.dxluq_type').html($(this).html());
	 $(".dxlux_div input[name=fstype]").val($(this).html());
	}
	$('.dxlqx_t ').addClass('hide');
	  event.stopPropagation();
	});
$(".dxlux_search").click(function(){
    var dxluxname = $(".dxluxname").val()=='请输入院校名称'?'':$(".dxluxname").val();
    var dxluq_province = $(".dxluq_province").html()=='生源地'?'':$(".dxluq_province").html();
    var dxluq_type = $(".dxluq_type").html()=='类型'?'':$(".dxluq_type").html();
    //alert($("dxluq_type").html()=='类型');
    if(!validfun(dxluxname))return false;
    window.open('/soudaxue/queryProvinceScore.html?province='+dxluq_province+'&fstype='+dxluq_type+'&keyWordForQueryparamsarraycore='+encodeURI(dxluxname),'_blank');
});
////////////////////////////////////////////////////////////////////////////////////////////////
//专业录取线
$(".zylqx_province_open").click(function(event){
	$(".div_floot").addClass('hide');
	  $(".zyluqx_p ").removeClass('hide');
	  event.stopPropagation();
});
$(".zyluqx_p a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.zylqx_province').html($(this).html());
		$(".zylqx_div input[name=province]").val($(this).html());
	}
	$('.zyluqx_p').addClass('hide');
	  event.stopPropagation();
	});



$(".zylqx_type_open").click(function(event){
	$(".div_floot").addClass('hide');
	  $(".zylqx_t ").removeClass('hide');
	  event.stopPropagation();
});
$(".zylqx_t a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.zylqx_type').html($(this).html());
		$(".zylqx_div input[name=fstype]").val($(this).html());
	}
	$('.zylqx_t').addClass('hide');
	  event.stopPropagation();
	});
$(".zylq_search").click(function(){
    var zylq_name = $(".zylq_name").val()=='专业或院校名称关键字'?'':$(".zylq_name").val();
    var zylqx_type = $(".zylqx_type").html()=='全部'?'':$(".zylqx_type").html();
    var zylqx_province = $(".zylqx_province").html()=='全部'?'':$(".zylqx_province").html();
    //alert($("dxluq_type").html()=='类型');
    if(!validfun(zylq_name))return false;
    window.open('/soudaxue/querySpecialtyScore.html?province='+zylqx_province+'&fstype='+zylqx_type+'&argkeyword='+encodeURI(zylq_name),'_blank');
});
////////////////////////////////////////////////////////////////////////////////////////////////
//录取人数


$(".lqrs_province_open").click(function(event){
	$(".div_floot").addClass('hide');
	$('.dqlqrs_p').removeClass('hide');
	  event.stopPropagation();
});
$(".dqlqrs_p a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.lqrs_province').html($(this).html());
		$(".lqrs_div input[name=argprovince]").val($(this).html());
	}
	$('.dqlqrs_p').addClass('hide');
	  event.stopPropagation();
	});

$(".lqrs_type_open").click(function(event){
	$(".div_floot").addClass('hide');
	$('.dqlqrs_t ').removeClass('hide');
	  event.stopPropagation();
});
$(".dqlqrs_t a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.lqrs_type').html($(this).html());
		$(".lqrs_div input[name=argluqutype]").val($(this).html());
	}
	$('.dqlqrs_t ').addClass('hide');
	  event.stopPropagation();
	});

$(".lqrs_year_open").click(function(event){
	$(".div_floot").addClass('hide');
	$('.y_ear ').removeClass('hide');
	  event.stopPropagation();
});
$(".y_ear a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.lqrs_year').html($(this).html().replace("年",""));		
		$(".lqrs_div input[name=argyear]").val($(this).html().replace("年",""));
	}
	$('.y_ear').addClass('hide');
	  event.stopPropagation();
	});

$(".lqrs_search").click(function(){	
    var zylq_name = $(".lqrs_name").val()=='请输入院校名称'?'':$(".lqrs_name").val();
    var lqrs_province = $(".lqrs_province").html()=='全部'?'':$(".lqrs_province").html();
    var lqrs_type = $(".lqrs_type").html()=='全部'?'':$(".lqrs_type").html();
    var lqrs_year = $(".lqrs_year").html()=='全部'?'':$(".lqrs_year").html();
    //alert($("dxluq_type").html()=='类型');
    if(!validfun(zylq_name))return false;
    window.open('/soudaxue/queryProvinceScoreNum.html?argprovince='+encodeURI(lqrs_province)+'&argluqutype='+encodeURI(lqrs_type)+'&keyWordForQueryparamsarraycore='+encodeURI(zylq_name)+'&argyear='+lqrs_year.replace('年', ''),'_blank');
});

////////////////////////////////////////////////////////////////////////////////////////////////
//大学    模糊匹配效果 start
jQuery(document).ready(function($){
	$.fn.AutoComplete = function(url,option){
	var me= this;
	var strKey= $(me).val();
	var strKeyBak= "";
	var isShow = true;
	var doption={
		iwidth: '0px',	//下拉框的宽度
		iLengthLower: 1,	//当表单的长度大于iLengthLower小于iLengthUpper时才开始执行搜索
		iLengthUpper: 50,
		strPara: "keyWord1",	//变量名称
		zIndex: 1,	//提示框的Z-INDEX值
		hasscroll: 0,	//是否出现滚动条0无1有
		hasclose: 1,	//是否拥有关闭窗口
		desfun:function(){}
	};
	
	$.extend(doption,option);	
	var iLengthLower= doption.iLengthLower;
	var iLengthUpper= doption.iLengthUpper;
	var strPara= doption.strPara;
	if ($("#autocomplete").length<1){$("<div id='autocomplete'></div>").insertAfter('body');}
	$("#autocomplete").hide();
	
	$(me).keyup(function(e){keysearch(e.keyCode);});
	$(me).keydown(function(e){LineSelect(e.keyCode);});
	$(me).bind("blur",function(){
		strKeyBak= $("#autocomplete ul .selected ").text();	//为click事件增加处理
		if (strKeyBak.length>0 && strKeyBak!=$(me).val()){
			$(me).val(strKeyBak);
			doption.desfun();
		};
		floorHide();
	});
	
	var encode=function(v){//如果包含中文就escape,避免重复escape)
  return escape(v).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 }
	
	function floorHide(){
		$("#autocomplete").hide().html("");
		strKey= "";
		isShow = false;
	}
	
	function floorShow(){
		var p= $(me).offset();
		var w= (doption.iwidth == "0px") ? $(me).width()+10: doption.iwidth;
		$("#autocomplete").css({
		 'z-index:':doption.zIndex,
		 width:w,
		 top:parseInt(p.top+$(me).outerHeight())+"px",
		 left:parseInt(p.left)+1+"px"
	 }).fadeIn(100);
		strKey= "";
		isShow = true;
	}
	
	function keysearch(code){
		var strKeyNow=$(me).val();
		if(code == 38 || code == 40 || code == 13 || code == 27 || code == 9) return;    //TAB/回车、ESC、向上、向下
		if((strKey == "" || strKeyNow != strKey) && strKeyNow.length >= iLengthLower && strKeyNow.length <= iLengthUpper){
		var kw1=document.getElementById("keyWord1").value;
		$.ajax({
					type : "GET",
					url : "/commonXML/allSchoolNames.xml",
					data : "",
					success : function(xmlobj) {
					var strContent="";
					var count=0;
					$(xmlobj).find("school").each(function(i){
						if(count<10){
							var schoolname = $(this).children("schoolname").text();
							if(schoolname.indexOf(kw1)>=0){
								schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
								strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
								count++;			
							}
						}
					});
			$('#autocomplete').html("<ul>"+strContent+"</ul>");
			$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
			if($.trim(strContent)==""){
				floorHide();
				return;
			}
			floorShow();
			strKey=$(me).val();
					}
			});
		}
		if(strKey.length == 0 || strKey.length <= iLengthLower || strKey.length >= iLengthUpper) floorHide();
	}	
	function LineSelect(code){
		if(code == 27){floorHide();};//回车键、ESC键
		if(code == 13){floorHide();doption.desfun();};
		if(!isShow) return;
		ObjSelected=$("#autocomplete ul .selected");
		if (ObjSelected.length>0){	//如果已经有选定
			if(code == 38){	//向上键
				if(ObjSelected.prev().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").prev().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}else if (code == 40){	//向下键
				if(ObjSelected.next().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").next().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}
		}else if(code == 38){
				$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:last ").text());
		}else if(code == 40){
				$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:first ").text());
		}
	}
}

	$('#keyWord1').AutoComplete()
})
//大学    模糊匹配效果 end
////////////////////////////////////////////////////////////////////////////////////////////////
//专业    模糊匹配效果 start
jQuery(document).ready(function($){
	$.fn.AutoComplete = function(url,option){
	var me= this;
	var strKey= $(me).val();
	var strKeyBak= "";
	var isShow = true;
	var doption={
		iwidth: '0px',	//下拉框的宽度
		iLengthLower: 1,	//当表单的长度大于iLengthLower小于iLengthUpper时才开始执行搜索
		iLengthUpper: 50,
		strPara: "keyWord2",	//变量名称
		zIndex: 1,	//提示框的Z-INDEX值
		hasscroll: 0,	//是否出现滚动条0无1有
		hasclose: 1,	//是否拥有关闭窗口
		desfun:function(){}
	};

	$.extend(doption,option);	
	var iLengthLower= doption.iLengthLower;
	var iLengthUpper= doption.iLengthUpper;
	var strPara= doption.strPara;
	if ($("#autocomplete").length<1){$("<div id='autocomplete'></div>").insertAfter('body');}
	$("#autocomplete").hide();

	$(me).keyup(function(e){keysearch(e.keyCode);});
	$(me).keydown(function(e){LineSelect(e.keyCode);});
	$(me).bind("blur",function(){
		strKeyBak= $("#autocomplete ul .selected ").text();	//为click事件增加处理
		if (strKeyBak.length>0 && strKeyBak!=$(me).val()){
			$(me).val(strKeyBak);
			doption.desfun();
		};
		floorHide();
	});
	
	var encode=function(v){//如果包含中文就escape,避免重复escape)
  return escape(v).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 }
	
	function floorHide(){
		$("#autocomplete").hide().html("");
		strKey= "";
		isShow = false;
	}
	
	function floorShow(){
		var p= $(me).offset();
		var w= (doption.iwidth == "0px") ? $(me).width()+10: doption.iwidth;
		$("#autocomplete").css({
		 'z-index:':doption.zIndex,
		 width:w,
		 top:parseInt(p.top+$(me).outerHeight())+"px",
		 left:parseInt(p.left)+1+"px"
	 }).fadeIn(100);
		strKey= "";
		isShow = true;
	}
	
	function keysearch(code){
	
		var strKeyNow=$(me).val();
		if(code == 38 || code == 40 || code == 13 || code == 27 || code == 9) return;    //TAB/回车、ESC、向上、向下
		if((strKey == "" || strKeyNow != strKey) && strKeyNow.length >= iLengthLower && strKeyNow.length <= iLengthUpper){
		var kw1=document.getElementById("keyWord2").value;
		var xml_url = "/commonXML/standardSpNames_ben.xml";
		$.ajax({
				type : "GET",
				url : xml_url,
				data : "",
				success : function(xmlobj) {
		
				var strContent="";
				var count=0;
				$(xmlobj).find("sp").each(function(i){
					if(count<10){
						var schoolname = $(this).children("spname").text();
						if(schoolname.indexOf(kw1)>=0){
							schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
							strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
							count++;			
						}
					}
				});
			$('#autocomplete').html("<ul>"+strContent+"</ul>");
			$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
			if($.trim(strContent)==""){
				floorHide();
				return;
			}
			floorShow();
			strKey=$(me).val();
					}
			});
		}
		if(strKey.length == 0 || strKey.length <= iLengthLower || strKey.length >= iLengthUpper) floorHide();
	}	
	function LineSelect(code){
		if(code == 27){floorHide();};//回车键、ESC键
		if(code == 13){floorHide();doption.desfun();};
		if(!isShow) return;
		ObjSelected=$("#autocomplete ul .selected");
		if (ObjSelected.length>0){	//如果已经有选定
			if(code == 38){	//向上键
				if(ObjSelected.prev().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").prev().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}else if (code == 40){	//向下键
				if(ObjSelected.next().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").next().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}
		}else if(code == 38){
				$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:last ").text());
		}else if(code == 40){
				$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:first ").text());
		}
	}
}

	$('#keyWord2').AutoComplete()
})
//专业    模糊匹配效果 end
////////////////////////////////////////////////////////////////////////////////////////////////
//专业    模糊匹配效果 start
jQuery(document).ready(function($){
	$.fn.AutoComplete = function(url,option){
	var me= this;
	var strKey= $(me).val();
	var strKeyBak= "";
	var isShow = true;
	var doption={
		iwidth: '0px',	//下拉框的宽度
		iLengthLower: 1,	//当表单的长度大于iLengthLower小于iLengthUpper时才开始执行搜索
		iLengthUpper: 50,
		strPara: "keyWord3",	//变量名称
		zIndex: 1,	//提示框的Z-INDEX值
		hasscroll: 0,	//是否出现滚动条0无1有
		hasclose: 1,	//是否拥有关闭窗口
		desfun:function(){}
	};
	
	$.extend(doption,option);	
	var iLengthLower= doption.iLengthLower;
	var iLengthUpper= doption.iLengthUpper;
	var strPara= doption.strPara;
	if ($("#autocomplete").length<1){$("<div id='autocomplete'></div>").insertAfter('body');}
	$("#autocomplete").hide();
	
	$(me).keyup(function(e){keysearch(e.keyCode);});
	$(me).keydown(function(e){LineSelect(e.keyCode);});
	$(me).bind("blur",function(){
		strKeyBak= $("#autocomplete ul .selected ").text();	//为click事件增加处理
		if (strKeyBak.length>0 && strKeyBak!=$(me).val()){
			$(me).val(strKeyBak);
			doption.desfun();
		};
		floorHide();
	});
	
	var encode=function(v){//如果包含中文就escape,避免重复escape)
  return escape(v).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 }
	
	function floorHide(){
		$("#autocomplete").hide().html("");
		strKey= "";
		isShow = false;
	}
	
	function floorShow(){
		var p= $(me).offset();
		var w= (doption.iwidth == "0px") ? $(me).width()+10: doption.iwidth;
		$("#autocomplete").css({
		 'z-index:':doption.zIndex,
		 width:w,
		 top:parseInt(p.top+$(me).outerHeight())+"px",
		 left:parseInt(p.left)+1+"px"
	 }).fadeIn(100);
		strKey= "";
		isShow = true;
	}
	
	function keysearch(code){
		var strKeyNow=$(me).val();
		if(code == 38 || code == 40 || code == 13 || code == 27 || code == 9) return;    //TAB/回车、ESC、向上、向下
		if((strKey == "" || strKeyNow != strKey) && strKeyNow.length >= iLengthLower && strKeyNow.length <= iLengthUpper){
		var kw1=document.getElementById("keyWord3").value;
		$.ajax({
				type : "GET",
				url : "/commonXML/standardSpNames_zhuan.xml",
				data : "",
				success : function(xmlobj) {
				var strContent="";
				var count=0;
				$(xmlobj).find("sp").each(function(i){

					if(count<10){
						var schoolname = $(this).children("spname").text();
						if(schoolname.indexOf(kw1)>=0){
							schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
							strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
							count++;			
						}
					}
				});
			$('#autocomplete').html("<ul>"+strContent+"</ul>");
			$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
			if($.trim(strContent)==""){
				floorHide();
				return;
			}
			floorShow();
			strKey=$(me).val();
					}
		 
			});
		}
		if(strKey.length == 0 || strKey.length <= iLengthLower || strKey.length >= iLengthUpper) floorHide();
	}	
	function LineSelect(code){
		if(code == 27){floorHide();};//回车键、ESC键
		if(code == 13){floorHide();doption.desfun();};
		if(!isShow) return;
		ObjSelected=$("#autocomplete ul .selected");
		if (ObjSelected.length>0){	//如果已经有选定
			if(code == 38){	//向上键
				if(ObjSelected.prev().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").prev().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}else if (code == 40){	//向下键
				if(ObjSelected.next().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").next().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}
		}else if(code == 38){
				$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:last ").text());
		}else if(code == 40){
				$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:first ").text());
		}
	}
}

	$('#keyWord3').AutoComplete()
})
//专业    模糊匹配效果 end
////////////////////////////////////////////////////////////////////////////////////////////////
//大学录取线  模糊匹配效果 start
jQuery(document).ready(function($){
	$.fn.AutoComplete = function(url,option){
	var me= this;
	var strKey= $(me).val();
	var strKeyBak= "";
	var isShow = true;
	var doption={
		iwidth: '0px',	//下拉框的宽度
		iLengthLower: 1,	//当表单的长度大于iLengthLower小于iLengthUpper时才开始执行搜索
		iLengthUpper: 50,
		strPara: "provinceScoreKEY",	//变量名称
		zIndex: 1,	//提示框的Z-INDEX值
		hasscroll: 0,	//是否出现滚动条0无1有
		hasclose: 1,	//是否拥有关闭窗口
		desfun:function(){}
	};
	
	$.extend(doption,option);	
	var iLengthLower= doption.iLengthLower;
	var iLengthUpper= doption.iLengthUpper;
	var strPara= doption.strPara;
	if ($("#autocomplete").length<1){$("<div id='autocomplete'></div>").insertAfter('body');}
	$("#autocomplete").hide();
	
	$(me).keyup(function(e){keysearch(e.keyCode);});
	$(me).keydown(function(e){LineSelect(e.keyCode);});
	$(me).bind("blur",function(){
		strKeyBak= $("#autocomplete ul .selected ").text();	//为click事件增加处理
		if (strKeyBak.length>0 && strKeyBak!=$(me).val()){
			$(me).val(strKeyBak);
			doption.desfun();
		};
		floorHide();
	});
	
	var encode=function(v){//如果包含中文就escape,避免重复escape)
  return escape(v).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 }
	
	function floorHide(){
		$("#autocomplete").hide().html("");
		strKey= "";
		isShow = false;
	}
	
	function floorShow(){
		var p= $(me).offset();
		var w= (doption.iwidth == "0px") ? $(me).width()+83: doption.iwidth;
		$("#autocomplete").css({
		 'z-index:':doption.zIndex,
		 width:w,
		 top:parseInt(p.top+$(me).outerHeight())+11+"px",
		 left:parseInt(p.left)-20+"px"
	 }).fadeIn(300);
		strKey= "";
		isShow = true;
	}
	
	function keysearch(code){
		var strKeyNow=$(me).val();
		if(code == 38 || code == 40 || code == 13 || code == 27 || code == 9) return;    //TAB/回车、ESC、向上、向下
		if((strKey == "" || strKeyNow != strKey) && strKeyNow.length >= iLengthLower && strKeyNow.length <= iLengthUpper){
		var kw1=document.getElementById("provinceScoreKEY").value;
		$.ajax({
					type : "GET",
					url : "/commonXML/allSchoolNames.xml",
					data : "",
					success : function(xmlobj) {
					var strContent="";
					var count=0;
					$(xmlobj).find("school").each(function(i){
						if(count<10){
							var schoolname = $(this).children("schoolname").text();
							if(schoolname.indexOf(kw1)>=0){
								schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
								strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
								count++;			
							}
						}
					});
			$('#autocomplete').html("<ul>"+strContent+"</ul>");
			$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
			if($.trim(strContent)==""){
				floorHide();
				return;
			}
			floorShow();
			strKey=$(me).val();
					}
			});
	
		}
		if(strKey.length == 0 || strKey.length <= iLengthLower || strKey.length >= iLengthUpper) floorHide();
	}
	
	function LineSelect(code){
		if(code == 27){floorHide();};//回车键、ESC键
		if(code == 13){floorHide();doption.desfun();};
		if(!isShow) return;
		ObjSelected=$("#autocomplete ul .selected");
		if (ObjSelected.length>0){	//如果已经有选定
			//alert('dasfdas');
			if(code == 38){	//向上键
				if(ObjSelected.prev().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").prev().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}else if (code == 40){	//向下键
				if(ObjSelected.next().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").next().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}
		}else if(code == 38){
				$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:last ").text());
		}else if(code == 40){
				$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:first ").text());
		}
	}
}

	$('#provinceScoreKEY').AutoComplete()
})
//大学录取线  模糊匹配效果end
////////////////////////////////////////////////////////////////////////////////////////////////
//专业录取线  模糊匹配效果start
jQuery(document).ready(function($){
	$.fn.AutoComplete = function(url,option){
	var me= this;
	var strKey= $(me).val();
	var strKeyBak= "";
	var isShow = true;
	var doption={
		iwidth: '0px',	//下拉框的宽度
		iLengthLower: 1,	//当表单的长度大于iLengthLower小于iLengthUpper时才开始执行搜索
		iLengthUpper: 50,
		strPara: "specialtyScoreKEY",	//变量名称
		zIndex: 1,	//提示框的Z-INDEX值
		hasscroll: 0,	//是否出现滚动条0无1有
		hasclose: 1,	//是否拥有关闭窗口
		desfun:function(){}
	};
	
	$.extend(doption,option);	
	var iLengthLower= doption.iLengthLower;
	var iLengthUpper= doption.iLengthUpper;
	var strPara= doption.strPara;
	if ($("#autocomplete").length<1){$("<div id='autocomplete'></div>").insertAfter('body');}
	$("#autocomplete").hide();
	
	$(me).keyup(function(e){keysearch(e.keyCode);});
	$(me).keydown(function(e){LineSelect(e.keyCode);});
	$(me).bind("blur",function(){
		strKeyBak= $("#autocomplete ul .selected ").text();	//为click事件增加处理
		if (strKeyBak.length>0 && strKeyBak!=$(me).val()){
			$(me).val(strKeyBak);
			doption.desfun();
		};
		floorHide();
	});
	
	var encode=function(v){//如果包含中文就escape,避免重复escape)
  return escape(v).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 }
	
	function floorHide(){
		$("#autocomplete").hide().html("");
		strKey= "";
		isShow = false;
	}
	
	function floorShow(){
		var p= $(me).offset();
		var w= (doption.iwidth == "0px") ? $(me).width()+10: doption.iwidth;
		$("#autocomplete").css({
		 'z-index:':doption.zIndex,
		 width:w,
		 top:parseInt(p.top+$(me).outerHeight())+"px",
		 left:parseInt(p.left)+1+"px"
	 }).fadeIn(300);
		strKey= "";
		isShow = true;
	}
	
	function keysearch(code){
		var strKeyNow=$(me).val();
		if(code == 38 || code == 40 || code == 13 || code == 27 || code == 9) return;    //TAB/回车、ESC、向上、向下
		if((strKey == "" || strKeyNow != strKey) && strKeyNow.length >= iLengthLower && strKeyNow.length <= iLengthUpper){
		var kw1=document.getElementById("specialtyScoreKEY").value;
		var isContinue=false;
		$.ajax({
				type : "GET",
				url :  "/commonXML/standardSpNames_all.xml",
				data : "",
				async:false,
				success : function(xmlobj) {
			var strContent="";
			var count=0;
				$(xmlobj).find("sp").each(function(i){
					if(count<10){
						
						var schoolname = $(this).children("spname").text();	
						if(schoolname.indexOf(kw1)>=0){
							isContinue=true;
							schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
							strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
							count=count+1;			
						}
					}
				});
				$('#autocomplete').html("<ul>"+strContent+"</ul>");
				$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
				if($.trim(strContent)==""){
					floorHide();
					return;
				}
				floorShow();
				strKey=$(me).val();
			}
		});
		if(!isContinue){
		$.ajax({
					type : "GET",
					url : "/commonXML/allSchoolNames.xml",
					data : "",
					success : function(xmlobj) {
					var strContent="";
					var count=0;
					$(xmlobj).find("school").each(function(i){
						if(count<10){
							var schoolname = $(this).children("schoolname").text();
							if(schoolname.indexOf(kw1)>=0){
								schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
								strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
								count++;			
							}
						}
					});
			$('#autocomplete').html("<ul>"+strContent+"</ul>");
			$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
			if($.trim(strContent)==""){
				floorHide();
				return;
			}
			floorShow();
			strKey=$(me).val();
					}
			});
		
		}
	
		}
		if(strKey.length == 0 || strKey.length <= iLengthLower || strKey.length >= iLengthUpper) floorHide();
	}
	
	function LineSelect(code){
		if(code == 27){floorHide();};//回车键、ESC键
		if(code == 13){floorHide();doption.desfun();};
		if(!isShow) return;
		ObjSelected=$("#autocomplete ul .selected");
		if (ObjSelected.length>0){	//如果已经有选定
			//alert('dasfdas');
			if(code == 38){	//向上键
				if(ObjSelected.prev().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").prev().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}else if (code == 40){	//向下键
				if(ObjSelected.next().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").next().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}
		}else if(code == 38){
				$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:last ").text());
		}else if(code == 40){
				$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:first ").text());
		}
	}
}

	$('#specialtyScoreKEY').AutoComplete()
})
//专业录取线  模糊匹配效果end
////////////////////////////////////////////////////////////////////////////////////////////////
//录取人数  模糊匹配效果start
jQuery(document).ready(function($){
	$.fn.AutoComplete = function(url,option){
	var me= this;
	var strKey= $(me).val();
	var strKeyBak= "";
	var isShow = true;
	var doption={
		iwidth: '0px',	//下拉框的宽度
		iLengthLower: 1,	//当表单的长度大于iLengthLower小于iLengthUpper时才开始执行搜索
		iLengthUpper: 50,
		strPara: "provinceScoreKEYNUM",	//变量名称
		zIndex: 1,	//提示框的Z-INDEX值
		hasscroll: 0,	//是否出现滚动条0无1有
		hasclose: 1,	//是否拥有关闭窗口
		desfun:function(){}
	};
	
	$.extend(doption,option);	
	var iLengthLower= doption.iLengthLower;
	var iLengthUpper= doption.iLengthUpper;
	var strPara= doption.strPara;
	if ($("#autocomplete").length<1){$("<div id='autocomplete'></div>").insertAfter('body');}
	$("#autocomplete").hide();
	
	$(me).keyup(function(e){keysearch(e.keyCode);});
	$(me).keydown(function(e){LineSelect(e.keyCode);});
	$(me).bind("blur",function(){
		strKeyBak= $("#autocomplete ul .selected ").text();	//为click事件增加处理
		if (strKeyBak.length>0 && strKeyBak!=$(me).val()){
			$(me).val(strKeyBak);
			doption.desfun();
		};
		floorHide();
	});
	
	var encode=function(v){//如果包含中文就escape,避免重复escape)
  return escape(v).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
 }
	
	function floorHide(){
		$("#autocomplete").hide().html("");
		strKey= "";
		isShow = false;
	}
	
	function floorShow(){
		var p= $(me).offset();
		var w= (doption.iwidth == "0px") ? $(me).width()+10: doption.iwidth;
		$("#autocomplete").css({
		 'z-index:':doption.zIndex,
		 width:w,
		 top:parseInt(p.top+$(me).outerHeight())+"px",
		 left:parseInt(p.left)+1+"px"
	 }).fadeIn(300);
		strKey= "";
		isShow = true;
	}
	
	function keysearch(code){
		var strKeyNow=$(me).val();
		if(code == 38 || code == 40 || code == 13 || code == 27 || code == 9) return;    //TAB/回车、ESC、向上、向下
		if((strKey == "" || strKeyNow != strKey) && strKeyNow.length >= iLengthLower && strKeyNow.length <= iLengthUpper){
		var kw1=document.getElementById("provinceScoreKEYNUM").value;
		$.ajax({
					type : "GET",
					url : "/commonXML/allSchoolNames.xml",
					data : "",
					success : function(xmlobj) {
					var strContent="";
					var count=0;
					$(xmlobj).find("school").each(function(i){
						if(count<10){
							var schoolname = $(this).children("schoolname").text();
							if(schoolname.indexOf(kw1)>=0){
								schoolname = schoolname.replace(kw1,"<span class='keyname'>"+kw1+"</span>");
								strContent = strContent+"<li class='keyinfo'>"+schoolname+"</li>";
								count++;			
							}
						}
					});
			$('#autocomplete').html("<ul>"+strContent+"</ul>");
			$("#autocomplete .keyinfo").mouseover(function(){$("#autocomplete .selected").removeClass("selected");$(this).removeClass("unselected").addClass("selected");}).mouseout(function(){$(this).removeClass("selected").addClass("unselected");}).click(function(){if(strKeyBak.length()>0){$(me).val(strKeyBak);}});
			if($.trim(strContent)==""){
				floorHide();
				return;
			}
			floorShow();
			strKey=$(me).val();
					}
			});
	
		}
		if(strKey.length == 0 || strKey.length <= iLengthLower || strKey.length >= iLengthUpper) floorHide();
	}
	
	function LineSelect(code){
		if(code == 27){floorHide();};//回车键、ESC键
		if(code == 13){floorHide();doption.desfun();};
		if(!isShow) return;
		ObjSelected=$("#autocomplete ul .selected");
		if (ObjSelected.length>0){	//如果已经有选定
			//alert('dasfdas');
			if(code == 38){	//向上键
				if(ObjSelected.prev().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").prev().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}else if (code == 40){	//向下键
				if(ObjSelected.next().text() != ""){	//如果不是第一个数据
					ObjSelected.removeClass("selected").addClass("unselected").next().removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}else{
					ObjSelected.removeClass("selected").addClass("unselected");
					$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
					$(me).val($("#autocomplete ul .selected ").text());
				}
			}
		}else if(code == 38){
				$("#autocomplete .keyinfo:last").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:last ").text());
		}else if(code == 40){
				$("#autocomplete .keyinfo:first").removeClass("unselected").addClass("selected");
				$(me).val($("#autocomplete .keyinfo:first ").text());
		}
	}
}

	$('#provinceScoreKEYNUM').AutoComplete()
})
document.body.onclick=function(event){ 	
	$(".div_floot").addClass('hide');
}
//录取人数   模糊匹配效果end
////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////
//估分选大学  start


$(".gfxdx_province").click(function(event){
	$(".div_floot").addClass('hide');
	 $(".gfxdx_p ").removeClass('hide');
	 event.stopPropagation();
});

$(".gfxdx_type").click(function(event){
	$(".div_floot").addClass('hide');
	  $(".gfxdx_t ").removeClass('hide');
	  event.stopPropagation();
});
$(".gfxdx_p a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
		$('.gfxdx_province_s').html($(this).html());
		$(".gfxdx_div input[name=province]").val(text_c);
	}
	$('.gfxdx_p').addClass('hide');
	  event.stopPropagation();
});

$(".gfxdx_t a").on("click",function(event){
	var text_c = $(this).html();
	if(text_c.indexOf('img')==-1){
	 $('.gfxdx_type_s').html($(this).html());
	 $(".gfxdx_div input[name=type]").val($(this).html());
	}
	$('.gfxdx_t ').addClass('hide');
	  event.stopPropagation();
	});
$(".gfxdx_search").on("click",function(event){
	var pro = $(".gfxdx_div input[name=province]").val();
	var type = $(".gfxdx_div input[name=type]").val();
	var mark = $(".gfxdx_mark").val();
	if(!/^[-\+]?\d+(\d+)?$/.test(mark)){
		alert("分数的格式不对，请输入数字");
		$("#mark").focus();
		return false;
	}
	if(mark>=1000||mark<100){
		alert("分数的格式不对，请输入三位数字");
		$("#mark").focus();
		return false;
	}
    window.open("/soudaxue/queryschoolgufen.html?province="+encodeURI(pro)+"&type="+encodeURI(type)+"&mark="+mark,'_blank');
});



//估分选大学 end
////////////////////////////////////////////////////////////////////////////////////////////////


$(".close").click(function(){
	  $(".df_lq ").addClass('hide');
	});
$(".div_floot ").click(function(event){
	event.stopPropagation();
});

//高考咨询 
$.ajax({
	url : "/html/tool/trs/3075_1299984378_u.html",
	dataType : 'html',
	type : 'GET',
	timeout : 2000,
	 error: function (XMLHttpRequest, textStatus, errorThrown) {
//          alert(errorThrown);
//         alert(XMLHttpRequest.status);
//          alert(XMLHttpRequest.readyState);
//          alert(textStatus);
 },
	success : function(xmlobj) {
//		alert(1);
		$("#gkzx").html(xmlobj);
	}
});

//-------------------特殊字符验证------------------
function validfun(keywordparam){
	if(keywordparam==""){
		return true;
	}
  var keyvalue =keywordparam;
  if(keyvalue.search(/[`~!@#$^&*()=|{}':;',\[\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'"。，、？]/)!=-1){
	  alert("关键字不能含有如：#￥$等特殊字符");
		return false;
  }
  var   pattern   =   /^[a-zA-Z]|[\u4E00-\u9FA5,-]+$/i;  
  if("specialtyScoreKEY"==keywordparam){
  	pattern   =   /^[a-zA-Z]|[\u3000]|[\u4E00-\u9FA5]|[\u3000]+$/i;
  }
   if(!pattern.test(keyvalue))
   {
      alert("请输入正确的中文名称关键字");
     document.getElementById(keywordparam).focus();
      return false;
   }
   if(keyvalue.length<2)
   {
      alert("请输入至少2个汉字");
      document.getElementById(keywordparam).focus();
      return false;
   }
  return true;
}

}); 